from utils.ops import get_language_model

model1=get_language_model('lm/language_model1gram_chinese.txt')
model2=get_language_model('lm/language_model2gram_chinese.txt')

def gram2_chinese(prob,tuple2_word):
    if tuple2_word not in model2 or tuple2_word[0] not in model1:
        return None
    cur_prob=prob*model2[tuple2_word]/model1[tuple2_word[0]]
    return cur_prob

def return_gram2_chinese_func():
    return gram2_chinese